enum Side{ sSHORT, sLONG };
enum Propo{ pNothing = -1, pAll, pHalf, pThird, pQuarter };
ref class GlobalVars;

ref struct AccountRegularOptions
{
	int optRiskPerTrade;
	int optRiskPerDay;
	bool optUseAdvisorAcc;
	String ^optAllocation;
	int optSubAcc;
};

ref struct AccountStrategy1Options
{
	float optLimit_1_Dest;
	Propo optLimit_1_Prop;
	float optLimit_2_Dest;
	Propo optLimit_2_Prop;
	float optLimit_3_Dest;
	Propo optLimit_3_Prop;
	float optLimit_4_Dest;
	Propo optLimit_4_Prop;
	int optTideStop;
	int optTideStopSpace;
	int optTideStopStartAfter;
	float optTriggerSpread;
	int optStopLossSpread;
	int optRoundANumber;
	int optRoundStopNumber;
};

ref class Account
{
public:
	void SaveDataToFile();
	void LoadDataFromFile(StreamReader^ sr);
	property int RiskInDollar { int get(){ return acc_opt->optRiskPerTrade; } }
	property int RiskPerDay { int get(){ return acc_opt->optRiskPerDay; } }
	property String^ Allocation { String^ get(){ return acc_opt->optAllocation; } }
	property int SubAcc { int get(){ return acc_opt->optSubAcc; } }
	property bool UseAdvisorAcc { bool get(){ return acc_opt->optUseAdvisorAcc; } }
	// Strategy 1
	property int TideStop { int get(){ return strg_opt->optTideStop; } }
	property int TideStopStartAfter { int get(){ return strg_opt->optTideStopStartAfter; } }
	property float TriggerSpread { float get(){ return strg_opt->optTriggerSpread; } }
	property int StopLossSpread { int get(){ return strg_opt->optStopLossSpread; } }
	property int RoundANumber { int get(){ return strg_opt->optRoundANumber; } }
	property int RoundStopNumber { int get(){ return strg_opt->optRoundStopNumber; } }

	property AccountStrategy1Options ^LimitOptions { AccountStrategy1Options ^get(){ return strg_opt; } }
	property TWS ^TwsPointer { TWS ^get(){ return tws_pointer; } }
	property AxTWSLib::AxTws ^Tws { AxTWSLib::AxTws ^get(){ return tws_pointer->tws; } }

	void ChangeAccountOptParameters(AccountRegularOptions ^ac);
	void ChangeStrategy1Parameters(AccountStrategy1Options ^lm);
	Propo ConvertToProp(int num);
	Propo ConvertToProp(String ^str);
	String^ PropToString(Propo prp);
	
	Account(AxTWSLib::AxTws ^twsp); // Constructor

protected:
	AccountRegularOptions ^acc_opt;
	AccountStrategy1Options ^strg_opt;
	TWS ^tws_pointer;
};
